import type {RouteRecordRaw} from "vue-router";

// 管理端路由
export const adminRoutes: RouteRecordRaw[] = [
    {
        path: '/adminLogin',
        name: 'adminLogin',
        component: () => import('@/views/admin/login/index.vue'),
        meta: {
            title: '管理员登录',
            hidden: true,   // 路由是否在菜单中隐藏，true：隐藏，false：显示
            admin: true
        }
    },
    {
        path: '/admin',
        name: 'admin',
        component: () => import('@/layout/admin/index.vue'),
        meta: {
            title: '',
            hidden: false,
            admin: true
        },
        redirect: '/home',
        children: [
            {
                path: '/home',
                name: 'home',
                component: () => import('@/views/admin/home/index.vue'),
                meta: {
                    title: '首页',
                    hidden: false,
                    icon: 'Home',
                    admin: true
                }
            }
        ]
    },
    {
        path: '/information',
        name: 'information',
        component: () => import('@/layout/admin/index.vue'),
        meta: {
            title: '信息管理',
            hidden: false,
            icon: 'Information',
            admin: true
        },
        redirect: '/information/statistics',
        children: [
            {
                path: '/information/statistics',
                name: 'statistics',
                component: () => import('@/views/admin/information/statistics/index.vue'),
                meta: {
                    title: '统计报表',
                    hidden: false,
                    icon: 'Statistics',
                    admin: true
                }
            },
            {
                path: '/information/consumption-record',
                name: 'consumption-record',
                component: () => import('@/views/admin/information/consumption-record/index.vue'),
                meta: {
                    title: '消费记录',
                    hidden: false,
                    icon: 'Consumption',
                    admin: true
                }
            }
        ]
    },
    {
        path: '/personnel',
        name: 'personnel',
        component: () => import('@/layout/admin/index.vue'),
        meta: {
            title: '人员管理',
            hidden: false,
            icon: 'Personnel',
            admin: true
        },
        redirect: '/personnel/adminInfo',
        children: [
            {
                path: '/personnel/adminInfo',
                name: 'adminInfo',
                component: () => import('@/views/admin/personnel/adminInfo/index.vue'),
                meta: {
                    title: '管理员信息',
                    hidden: false,
                    icon: 'Admin',
                    admin: true
                }
            },
            {
                path: '/personnel/coach',
                name: 'coach',
                component: () => import('@/views/admin/personnel/coach/index.vue'),
                meta: {
                    title: '教练管理',
                    hidden: false,
                    icon: 'Coach',
                    admin: true
                }
            },
            {
                path: '/personnel/memberItem',
                name: 'memberItem',
                //component: () => import('@/layout/admin/index.ts'),
                meta: {
                    title: '会员管理',
                    hidden: false,
                    icon: 'MemberItem',
                    admin: true
                },
                redirect: '/personnel/memberItem/member',
                children: [
                    {
                        path: '/personnel/memberItem/member',
                        name: 'member',
                        component: () => import('@/views/admin/personnel/member/Member.vue'),
                        meta: {
                            title: '会员管理',
                            hidden: false,
                            icon: 'Member',
                            admin: true
                        },
                    },
                    {
                        path: '/personnel/memberItem/normalUser',
                        name: 'normalUser',
                        component: () => import('@/views/admin/personnel/member/NormalUser.vue'),
                        meta: {
                            title: '普通用户管理',
                            hidden: false,
                            icon: 'NormalUser',
                            admin: true
                        },
                    }
                ]
            }
        ]
    },
    {
        path: '/resource',
        name: 'resource',
        component: () => import('@/layout/admin/index.vue'),
        meta: {
            title: '资源管理',
            hidden: false,
            icon: 'Resource',
            admin: true
        },
        redirect: '/resource/course',
        children: [
            {
                path: '/resource/course',
                name: 'course',
                component: () => import('@/views/admin/resource/course/index.vue'),
                meta: {
                    title: '课程管理',
                    hidden: false,
                    icon: 'Course',
                    admin: true
                }
            },
            {
                path: '/resource/equipment',
                name: 'equipment',
                component: () => import('@/views/admin/resource/equipment/index.vue'),
                meta: {
                    title: '设备管理',
                    hidden: false,
                    icon: 'Equipment',
                    admin: true
                }
            }
        ]
    }
]